#ifndef __IMG_ENCODER_H__
#define __IMG_ENCODER_H__

#include <stdio.h>

#include <string>

#include "amba_net.h"

class ImageEncoder : public AmbaNet {
 public:
  ImageEncoder() noexcept;
  ~ImageEncoder();

  ImageEncoder(ImageEncoder const &) = delete;
  ImageEncoder(ImageEncoder const &&) = delete;
  ImageEncoder &operator=(ImageEncoder const &) = delete;
  ImageEncoder &operator=(ImageEncoder const &&) = delete;
  bool SetImageFromFile(std::string const &path,
                        std::uint8_t image_id) noexcept;
  bool SetImageFromBuf(char *input_buffer, std::uint32_t buffer_size,
                       std::uint8_t image_id) noexcept;
  void test();

  static constexpr std::uint8_t kImageNum{6};

 private:
  std::uint32_t free_all_buffer();
  // memory blocks
  flexidag_memblk_t input_image_buf_[kImageNum];
};

#endif